import Layout from '../layout/index.vue'
const routes = [
  {
    path: '/',
    name: 'home',
    component: Layout,
    children: [
      {
        path: '/home',
        component: () => import('./../views/home/index.vue'),
        meta: {
          path: '/home',
          title: '系统首页',
          icon: 'home'
        }
      }
    ]
  },
  {
    path: '/banner',
    name: 'banner',
    redirect: '/banner/list',
    meta: { title: '轮播图管理', icon: 'picture' },
    component: Layout,
    children: [
      {
        path: 'list',
        component: () => import('./../views/banner/index.vue'),
        meta: { path: '/banner/list', title: '轮播图列表', icon: 'unordered-list' }
      },
      {
        path: 'add',
        component: () => import('./../views/banner/add.vue'),
        meta: { path: '/banner/add', title: '添加轮播图', icon: 'unordered-list' }
      }
    ]
  },
  {
    path: '/pro',
    name: 'pro',
    redirect: '/pro/list',
    meta: { title: '产品管理', icon: 'shop' },
    component: Layout,
    children: [
      {
        path: 'list',
        component: () => import('./../views/pro/index.vue'),
        meta: { path: '/pro/list', title: '产品列表', icon: 'unordered-list' }
      },
      {
        path: 'recommend',
        component: () => import('./../views/pro/recommend.vue'),
        meta: { path: '/pro/recommend', title: '推荐列表', icon: 'unordered-list' }
      },
      {
        path: 'seckill',
        component: () => import('./../views/pro/seckill.vue'),
        meta: { path: '/pro/seckill', title: '秒杀列表', icon: 'unordered-list' }
      },
      {
        path: 'search',
        component: () => import('./../views/pro/search.vue'),
        meta: { path: '/pro/search', title: '筛选列表', icon: 'unordered-list' }
      }
    ]
  },
  {
    path: '/user',
    name: 'user',
    redirect: '/user/list',
    meta: { title: '账户管理', icon: 'usergroup-add' },
    component: Layout,
    children: [
      {
        path: 'list',
        component: () => import('./../views/user/index.vue'),
        meta: { path: '/user/list', title: '用户列表', icon: 'unordered-list' }

      },
      {
        path: 'admin',
        component: () => import('./../views/user/admin.vue'),
        meta: { path: '/user/admin', title: '管理员列表', icon: 'unordered-list' }
      }
    ]
  }
]

export default routes
